package com.demo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 药物提醒规则配置表
 * @author ZM
 * @since 2020-11-23
 */
@Data
@TableName("pd_message_rule")
@ApiModel(value="MessageRule对象", description="药物提醒规则配置表")
public class MessageRule implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "规则编号-主键ID")
    @TableId(value = "message_rule_id",type = IdType.AUTO)
    private Integer messageRuleId;

    @ApiModelProperty(value = "药物编号")
    @TableField("medicine_id")
    @NotNull(message = "药物编号不能为空")
    private Integer medicineId;

    @ApiModelProperty(value = "消息内容")
    @TableField("message_content")
    @NotBlank(message = "消息内容不能为空")
    private String messageContent;

    @ApiModelProperty(value = "是否循环提醒  1.是   2.否")
    @TableField("is_loop_warning")
    private Integer isLoopWarning;

    @ApiModelProperty(value = "时间间隔")
    @TableField("cycle_interval")
    private Integer cycleInterval;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    @NotNull(message = "创建人ID不能为空")
    private Integer createdUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "更新人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "删除时间")
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedTime;

    @ApiModelProperty(value = "删除人ID")
    @TableField("deleted_user_id")
    private Integer deletedUserId;

    @ApiModelProperty(value = "排序字段")
    @TableField("item_sort")
    private Integer itemSort;
}
